package com.briup.pts.web.controller;

import com.briup.pts.config.response.Result;
import com.briup.pts.domain.bean.Batch;
import com.briup.pts.service.BatchService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/batch")
@RequiredArgsConstructor
public class BatchController {

    private final BatchService service;

    @GetMapping("/queryAll")
    public Result<?> queryAll(){
        List<Batch> batches = service.queryAll();
        return Result.success(batches);
    }
}
